package jeni2.VCD;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

public class login extends Activity {
    /** Called when the activity is first created. */
	private EditText username, password;
	private Button login, reset;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.formlogin);
        username = (EditText) findViewById(R.id.username);
        password = (EditText) findViewById(R.id.password);
        login = (Button) findViewById(R.id.login);
        login.setOnClickListener(new OnClickListener() {
			
			public void onClick(View arg0) {
				// TODO Auto-generated method stub
				if(username.getText().toString().equals("fendy") && password.getText().toString().equals("indy")){
					Intent intent = new Intent(login.this, menu.class);
					startActivity(intent);
					username.setText("");
					password.setText("");
					username.requestFocus();
				}else{
					Toast.makeText(login.this, "Salan Password atau username",
							Toast.LENGTH_LONG).show();
					username.setText("");
					password.setText("");
					username.requestFocus();
				}
			}
		});
        reset = (Button) findViewById(R.id.reset);
        reset.setOnClickListener(new OnClickListener() {
			
			public void onClick(View arg0) {
				// TODO Auto-generated method stub
				username.setText("");
				password.setText("");
				username.requestFocus();
			}
		});
    }
}